function textInsert() {
    var text = document.getElementById("MarkdownInput").value;

    insertText('<br>[md][markdownNextLine]');
    for (var i = 0; i <=text.length; i = i + 1) {
        if (i == text.length || text.charAt(i) == '\n') {
            insertText("[markdownNextLine]");
        } else {
            insertText(text.charAt(i));
        }
    }
    insertText('[markdownNextLine][/md]<br>');
}